package org.example.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 租户表
 * @TableName erp_tenant
 */
@TableName(value ="erp_tenant")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ErpTenant implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 租户id
     */
    private Long tenantId;

    /**
     * 登录名
     */
    private String loginName;

    /**
     * 用户数量限制
     */
    private Integer userNumLimit;

    /**
     * 租户类型，0免费租户，1付费租户
     */
    private String type;

    /**
     * 启用 0-禁用  1-启用
     */
    private Integer enabled;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 到期时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expireTime;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public ErpTenant (Long tenantId, String loginName, Integer userNumLimit, String type, Integer enabled, Date createTime, Date expireTime){
        this.tenantId = tenantId;
        this.loginName = loginName;
        this.userNumLimit = userNumLimit;
        this.type = type;
        this.enabled = enabled;
        this.createTime = createTime;
        this.expireTime = expireTime;
    }
    
}